{% extends "basic.html" %}

{% block content %}
	<div class="main fr">
		{% if news %}
        <div class="text">
	        <div class="news">
	        	<h3>{{ news.title }}</h3>
	        	<div class="date">作者：{{ news.author }} &nbsp;&nbsp;&nbsp;发表时间:&nbsp;{{ news.post_time|date:"Y-m-d H:i" }}</div>
	        	<p>{{ news.content }}</p>
	        	{% if news.image %}
	        	<img src="{{ news.image.url }}" class="oneimage" />
	       		{% endif %}
          	</div>
        </div>
        {% endif %}
        
        <h2>所有新闻</h2>
        <div class="text">
        {% if user.is_admin %}
          	<a href="/admin/home/news/add/">发布新闻</a>
        {% endif %}
        {% for new in news_list %}
      		<div class="list"><a href="/news/{{ new.id }}/">{{ new.title }}</a> 
				<span>发表时间:&nbsp;{{ new.post_time|date:"Y-m-d H:i" }}</span>
			</div>
      	{% endfor %}
        </div>
        <div class="clearfix"></div>
      </div>
{% endblock %}